package com.wangsong.system.service;

import com.wangsong.common.model.JsonTreeData;
import com.wangsong.system.entity.Resources;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wangsong.system.entity.Role;
import com.wangsong.system.entity.RoleResources;
import com.wangsong.system.entity.UserRole;
import com.wangsong.system.vo.RoleAddVO;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

import java.util.List;
import java.util.Set;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author jobob
 * @since 2021-09-18
 */
public interface IResourcesService extends IService<Resources> {
    void deleteResources(Long id);

    void insertResources(Resources resources);

    List<JsonTreeData> findResources();

    List<Resources> findResourcesEMUByResources(List<UserRole> one);

    void updateResources(Resources resources);

    Resources selectByPrimaryKey(Long id);

    Set<SimpleGrantedAuthority> loadUserByUser(List<UserRole> user) throws UsernameNotFoundException;

    void saveBatchroleResources(Long[] resourcesIds, Role role);

    void removeRoleResource(Role role);

    void removeRoleResources(Long[] id);

    List<RoleResources> listRoleResources(Long roleId);
}
